<?xml version="1.0" ?>

<xsl:stylesheet   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
						xmlns:lzc="http://schemas.icitadel.com/Lazarus/Compiled.xsd"
                  version="1.0">

   <xsl:output method="text"/>

	<xsl:include href="../../common.xsl" />
	<xsl:include href="../../convert.xsl" />
   
   <xsl:template match="lzc:project"><xsl:apply-templates select="//lzc:collection[ @compiling ]" /></xsl:template>

   <xsl:template match="lzc:collection">
			<xsl:variable name="v_XmlNamespace">lz:</xsl:variable>
         <xsl:variable name="v_DetailName">Derived.<xsl:value-of select="@object" /><xsl:text>Detail</xsl:text>
         </xsl:variable>
         <xsl:variable name="v_CollectionName">
            <xsl:value-of select="@object" /><xsl:text>Collection</xsl:text>
         </xsl:variable>
         <xsl:variable name="v_NamespacePrefix">
				<xsl:if test="defaultnamespaceprefix">
					<xsl:value-of select="defaultnamespaceprefix" />
					<xsl:text>:</xsl:text>
				</xsl:if>
         </xsl:variable>
         <xsl:variable name="v_RuntimeNamespace">
				<xsl:if test="ancestor::lzc:project/@defaultnamespace">
					<xsl:value-of select="ancestor::lzc:project/@defaultnamespace"/>
				</xsl:if>
         </xsl:variable>
         <xsl:variable name="v_BusinessConceptNamespace">
				<xsl:if test="/lzc:project/@businessconcept">
					<xsl:text>.</xsl:text>
					<xsl:value-of select="/lzc:project/@businessconcept" />
				</xsl:if>
         </xsl:variable>
<xsl:text>using System;
using System.Collections;
using System.Data;
using System.Xml;

</xsl:text>

<xsl:text>namespace </xsl:text>
	<xsl:value-of select="$v_RuntimeNamespace" />
	<xsl:text>.Business.Entities</xsl:text>
	<xsl:value-of select="$v_BusinessConceptNamespace" /><xsl:text>
{
   public class </xsl:text>
		<xsl:value-of select="$v_CollectionName" />
		<xsl:text> : </xsl:text>
		<xsl:value-of select="$v_RuntimeNamespace" />
		<xsl:text>.Business.Entities</xsl:text>
		<xsl:value-of select="$v_BusinessConceptNamespace" />
		<xsl:text>.Generated.</xsl:text>
		<xsl:value-of select="$v_CollectionName" />
   {

   }
}
   </xsl:template>

</xsl:stylesheet>